-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framework: Stop forcing CMake to pass to -fPIE on all compilations, as this leads to link failures with Intel 19 #10984
Conversation
…ns, as this leads to link failures with Intel 19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of removing support for setting -fpic
, lets just change the default from ON
to OFF
. See comment below.
I can make the change and push a new commit if you like.
# FPIC | ||
IF (ATDM_FPIC) | ||
SET(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Build targets with position independent code") | ||
ENDIF() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PhilMiller, I just remembered that some SPARC builds expect fpic to be on for its shared builds. Therefore, to remove this may break SPARC's usage.
How about we change the default for fpic from on to off and require those shared builds that want to set fpic to have to on have to include the keyword fpic
the build name? Then the SPARC shared builds that need fpic could just add the keyword fpic
to their build names.
So we would update:
Then we could leave this logic here?
I think to change the default we just need to edit the following files:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which does SPARC actually want, -fPIC
so it can link objects into shared libraries, or -fPIE
to link objects into Position-Independent Executables? PIE is generally only desirable for relocatable loading to support ASLR in a server process, or for very niche use cases in which other processes will load an executable image as a dynamic library.
The ATDM_FPIC
setting is currently asking CMake to provide PIE, according to https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE and its observed behavior, which besides breaking builds, also hurts performance if it's used in circumstances where it's not actually necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rppawlo asked me to weigh in. SPARC wants Trilinos static libraries so that we can link them into either shared or static builds of our application executables.
The thing is, the underlying CMake variable doesn't control setting |
Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
Yes, when shared libraries are built (i.e. and:
|
Maybe use: and try using
Or could we just set |
This Pull Request has been marked for closure due to inactivity. |
AFAIK, this hasn't changed. Closure on this one should come after Intel classic is out of use, or testing shows it's fixed. |
Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
The ATDM configure/build system is no longer in-use. The changes to |
@trilinos/framework @bartlettroscoe
Fixes #10982
Motivation
Prevent dynamic linking failures like this:
Stakeholder Feedback
Testing
I manually tested this with Intel 19.0.5 ATDM compiler configuration, and confirmed that EMPIRE built on top of Trilinos with this modification built and ran successfully.
Automatic testing would be dependent on having a system and target suitably configured.